/*
angularjs 指令
*/
Directives=angular.module("Directives",[]);
/*菜单指令
 1.0 lanmushan 2016/07/15
*/
Directives.directive("naa",function(){
	return {
		restrict:'E',
		replace:true,
		templateUrl:'model/Nav.html'
		 
        }

});	
Directives.directive("siMenu",function(){
	return {
		restrict:'E',
		replace:true,
		templateUrl:'model/menu.html',
		 link: function (scope, iElement, iAttrs) {
		 	
         	$(".list-group-item").on("click",function(){
         		$(".list-group-item").removeClass("active");
         		$(this).addClass("active");
         		$(this).parent().siblings().find("ul").removeClass("in")
         	})
        }
	}
});	
/*菜单指令
 1.0 lanmushan 2016/07/15
*/

/*菜单指令
 1.0 lanmushan 2016/07/15
*/
Directives.directive("siNav",['$interval',function($interval){
	var link=function(scope, iElement, iAttrs) {
		scope.weekTime=["日","一","二","三","四","五","六"];
		var timer=$interval(function(){
				scope.time=new Date();
				scope.year=scope.time.getFullYear();
				scope.month=scope.time.getMonth()+1;
				scope.day=scope.time.getDate();
				scope.hours=scope.time.getHours();
				scope.min=scope.time.getMinutes();
				scope.sec=scope.time.getSeconds();
				scope.week=scope.time.getDay();
				
				
		},1000)
	};

	//返回指令定义对象
	return {
		restrict:'E',
		replace:true,
		templateUrl:'model/Nav.html',
		link: link
	};
}]);
